package me.gm.stcont.repository;

import java.util.List;

import me.gm.stcont.model.User;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface UserRepository extends JpaRepository<User, Integer> {

	User findByUserName(String userName);

	@Query("select user from User user left join user.stores as store where store.id = :storeId)")
	List<User> findByStoreId(@Param("storeId") Integer storeId);

}
